# 元组内的元素可以是任意类型
# tup1 = (123, 3.14, "字符串", (1, 2, 3), [1, 2], {'key': "value"})
# print(tup1)
# print(type(tup1))
#
# # 只有一个元素的元组怎么定义
# tup2 = (123,)
# print(tup2)
# print(type(tup2))

# # 获取指定下标的元素
# print(tup1[1])
# print(tup1[-1])

# # 元组切片
# print(tup1[1:3])

# # 元组拼接
# tup1 = ('NN',221,246)
# tup3 = ('MS246',)
# # new = tup1[0:2]+tup3
# # print(new)
# new2 = tup3*3
# print(new2)

# # 元组常用方法
# tup = (5, 4, 7, 34, 74, 3, 3, 3, 24, 56, 36, 86, 35, 77)
# # print(tup.count(3))	# 统计指定元素有几个
# # print(tup.index(3))	# 获取指定元素下标，只会获得第一个
# print(len(tup))  # 获取元组长度

tup1 = (123, 3.14, "字符串", (1, 2, 3), [1, 2], {'key': "value"})
del tup1[4][1]
print(tup1)
del tup1
print(tup1)